﻿using System;

class ExtractValue
{
    static void Main()
    {       
        Console.Write("Enter integer number: ");
        int number = int.Parse(Console.ReadLine());
        Console.Write("Enter bit position: ");
        int bitPosition = int.Parse(Console.ReadLine());
        
        int value = 1;
        int mask = value << bitPosition; // Move the 1st bit left by bitPosition positions

        // If value & mask are positive then the bitPosition bit of number is 1
        Console.WriteLine((number & mask) != 0 ? 1 : 0);
    }
}

